#include <iostream>
using namespace std;

//general template
template <int N>
struct Factorial 
{
  static const int value = N * Factorial<N-1>::value;
};

//template specialization 
template <>
struct Factorial<0> 
{
  static const int value = 1;
};
 



int main()
{
//   int x = Factorial<-1>::value;//the compiler will be in nonterminated loop
  int x = Factorial<6>::value;
  cout<<x<<endl;
  int y = Factorial<0>::value;
  cout<<y<<endl;
  return 0;
}
